<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="8">
          <el-form-item label="入库单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="入库日期" prop="FBILLCREDATE">
            <el-date-picker v-model="dataForm.FBILLCREDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="批次码"" prop="FBATCH">
            <el-input v-model="dataForm.FBATCH"   />
          </el-form-item>
        </el-col>

          <el-col :span="8">
          <el-form-item label="食材编号"" prop="FITEMNO">
            <el-input v-model="dataForm.FITEMNO"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="食材名称"" prop="FITEMNAME">
            <el-input v-model="dataForm.FITEMNAME"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="食材规格"" prop="FSPEC">
            <el-input v-model="dataForm.FSPEC"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="供应商">
              <el-select v-model="dataForm.FSUPNAME" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
          <el-form-item label="重量/数量"" prop="FQTY">
            <el-input v-model="dataForm.FQTY"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="单位"" prop="FUNIT">
            <el-input v-model="dataForm.FUNIT"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="操作人员"" prop="FUSER">
            <el-input v-model="dataForm.FUSER"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item  label="操作时间" prop="FTIME">
              <el-input v-model="dataForm.FTIME" />
          </el-form-item>
       </el-col>


        <el-col :span="8">
          <el-form-item label="操作说明" prop="FNOTE">
            <el-input v-model="dataForm.FNOTE"   />
          </el-form-item>
        </el-col>

            
        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加场地</el-button> -->
            <el-button type="primary" :loading="loading" @click="closePage">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <template>
     <el-tabs v-model="activeName" type="card" @tab-click="handleClick">

      <el-tab-pane label="入库照片" name="second">
        
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          
          <el-col :span="12">
          <el-upload
            class="avatar-uploader"
            action="https://jsonplaceholder.typicode.com/posts/"
            :show-file-list="false"
            :on-success="handleAvatarSuccess"
            :before-upload="beforeAvatarUpload">
            <img v-if="imageUrl1" :src="imageUrl1" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-col>
         </el-form>

      </el-tab-pane>

      <!-- <el-tab-pane label="联系人员" name="four">
        <el-table :data="list3" border stripe>
          <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FPOINT" label="职务"  width="95"></el-table-column>
          <el-table-column prop="FWORK" label="职责"   ></el-table-column>
          <el-table-column prop="FCATNAME" label="姓名" width="105" ></el-table-column>
          <el-table-column prop="FTEL" label="电话号码"   ></el-table-column>
          <el-table-column prop="FEMAIL" label="电子邮箱"   ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div>
      </el-tab-pane> -->

    </el-tabs>
    
   </template>

    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        activeName: 'second',
        imageUrl1:require('@/assets/images/me/lims070304.png'),

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLNO: "K241130001", 
            FBILLCREDATE:"2024-11-30",
            FSUPNAME: "萧山银龙农业发展有限公司",
            FITEMNO:"100002",
            FITEMNAME: "油麦菜",
            FSPEC:"500g",
            FUNIT: "公斤",
            FQTY: "28",
            FBATCH:"30000120251130100002009",
            FUSER: "入库员",
            FTIME:"2025-11-30 06:31:09",
            FNOTE:"",
            FBILLTYPE:"入库"
        },
        rules: {
          FUSERNUMBER:[
            { required: true, message: '请输入学籍号码', trigger: 'blur' },
          ],
          FUSER: [
            { required: true, message: '请输入申请人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入申请理由', trigger: 'blur' },
          ],
        },
        list1: [{ "FENTRYID":1,
                  "FTYPE": "旅游社经营许可证",
                  "FDATE":"2028-12-31",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FTYPE": "企业营业执照",
                  "FDATE":"2045-02-09",
                  "FMEMO": ""
                }],
        
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '新机构'
        }, {
          value: '2',
          label: '改机构'
        }, {
          value: '3',
          label: '老机构'
        }],

        
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      closePage(){
        console.log('关闭弹窗dialog');
        this.visible = false;
      },
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shopdate(id) {
        let link = document.createElement('a');
        link.href = 'http://180.166.193.6:90/images/study/acc-01.png';
        link.target = '_blank'; // 在新窗口或新标签页中打开URL
        link.click();
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>